<?php
/*
+-----------------------------------------------------------------------------+
| $Id: clean_content_attach.php 2010-05-24 12:37:44Z Bleakwind $
| Clean content_attach cache
| Copyright (c) 2003-2010 Bleakwind (www.weaverdream.com)
| http://www.weaverdream.com/
| Release under the GNU Lesser General Public License Version 3 (LGPLv3):
|   http://www.gnu.org/licenses/lgpl.html
+-----------------------------------------------------------------------------+
*/

if (!defined( 'ENTRY_INDEX')){
    echo "<h1>Forbidden</h1><p>You don't have permission to access on this server.</p>";
    exit;
}

// Admin group add and amend ajax
function submit_form($type, $value, $submit)
{
    global $LANGUAGE,$LANGLIST,$SETTING,$CONFIGURE,$MEMBER,$ADMIN,$db,$sys,$c,$setting_cover,$setting_attach,$sys,$ac;
    $ajax_response = new xajaxResponse();
    $error = false;
    //$ajax_response->alert(print_r($value, true)); $ajax_response->assign($submit,"disabled",false); return $ajax_response;

    if( $type != "clean" ) {
        $ajax_response->alert("发送请求不为清空!");
        $ajax_response->assign($submit,"value",$submit_value);
        $ajax_response->assign($submit,"disabled",false);
    }else{
        $clean_dir = $SETTING['dir_build_content_attach'];
        func::del_dir($clean_dir);
        $ajax_response->alert("清空发布内容附件缓存成功!");
        $ajax_response->assign($submit,"value","清空发布内容附件缓存");
        $ajax_response->assign($submit,"disabled",false);
    }
    return $ajax_response;
}
$bwajax->register(XAJAX_FUNCTION, "submit_form");
//////
?>
